Ext.ns("liang.mgr");
liang.mgr.SubmitWindow = Ext.extend(Ext.Window, {
			parentCt : null,
			// 实例化时添加
			newFormPanel : null,
			// 提交后的提示内容
			url : null,
			success:null,
			failure:null,
			saveText : 'Save',
			cancelText:'Cancel',
			initComponent : function() {
				if (this.newFormPanel) {
					this.items = this.newFormPanel;
				}
				liang.mgr.SubmitWindow.superclass.initComponent.call(this);
			},
			constructor : function(cfg) {
				cfg = cfg || {};
				Ext.apply(this, cfg);

				liang.mgr.SubmitWindow.superclass.constructor.call(this, {
							layout : "fit",
							style : 'padding : 1',
							buttons : [{
										scope : this,
										text : this.saveText,
										handler : this.submit
									}, {
										text : this.cancelText,
										scope : this,
										handler : this.reset
									}]
						});
			},
			setUrl : function(_url) {
				this.url = _url;
			},
			setNewFormPanel : function(fromPanel) {
				this.newFormPanel = fromPanel;
				this.add(fromPanel);
			},
			submit : function(btn, evt) {
				var _submitCfg = {
					scope : this,
					clientValidation : true,
					url : this.url,
					success : this.success,
					failure : this.failure
				};
				this.newFormPanel.form.submit(_submitCfg);
			},
			reset : function(btn, evt) {
				this.newFormPanel.form.reset();
			}
//			,
//			success : function(form, action) {
//			},
//			failure : function(form, action) {
//			}
		})